import 'package:fish_redux/fish_redux.dart';

enum HomeworkPostAction {
  action,
  next,
  onDone,
  selectClass,
  onSubject,
  selectType,
  onEdit,
  edit,
  onStartTime,
  onEndTime,
  startTime,
  endTime,
  value,
}

class HomeworkPostActionCreator {
  static Action onAction() {
    return const Action(HomeworkPostAction.action);
  }

  static Action next() {
    return const Action(HomeworkPostAction.next);
  }

  static Action onDone() {
    return const Action(HomeworkPostAction.onDone);
  }

  static Action selectClass(String id) {
    return Action(HomeworkPostAction.selectClass, payload: id);
  }

  static Action onSubject() {
    return const Action(HomeworkPostAction.onSubject);
  }

  static Action selectType(String type) {
    return Action(HomeworkPostAction.selectType, payload: type);
  }

  static Action onEdit(String action) {
    return Action(HomeworkPostAction.onEdit, payload: action);
  }

  static Action edit(Map<String, String> ret) {
    return Action(HomeworkPostAction.edit, payload: ret);
  }

  static Action onStartTime() {
    return Action(HomeworkPostAction.onStartTime);
  }

  static Action startTime(DateTime start) {
    return Action(HomeworkPostAction.startTime, payload: start);
  }

  static Action onEndTime() {
    return Action(HomeworkPostAction.onEndTime);
  }

  static Action endTime(DateTime end) {
    return Action(HomeworkPostAction.endTime, payload: end);
  }

  static Action value(Map<String, double> values) {
    return Action(HomeworkPostAction.value, payload: values);
  }
}
